package com.raos.kafka.serializer;

import org.apache.kafka.common.serialization.Serializer;
import java.util.Map;

/**
 * kafka入门之序列化操作 -- 生产者用到的序列化工具
 *
 * @author raos
 * @emil 991207823@qq.com
 * @date 2021/6/19 22:45
 */
public class ProtobufSerializer implements Serializer<Protobufable> {
    //
    @Override
    public void configure(Map<String, ?> configs, boolean isKey) {}

    @Override
    public byte[] serialize(String topic, Protobufable data) {
        return data.encode();
    }

    @Override
    public void close() {}
}

